import { Injectable } from '@angular/core';
import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';

@Injectable({
  providedIn: 'root'
})
export class NotarizationInfoService {
  constructor() { }
  public notayId = ''//公证处的ID
  public notayUse:any //公证用途
  public notayMatter = []//公证事项
  public Matters = []//公证事项详情
  public transactor:any //办理人
  public agent:any //代理人
  public orderFrom:any = ""//订单
  public isDaiBan:any//是否代办

  //存储获取删除公证处ID
  setNotayId(info:any){
    this.notayId = info
  }
  getNotayId(){
    return this.notayId
  }
  removeNotayId(){
    this.notayId = ''
  }

  //存储获取删除公证用途
  setNotayUse(info:any){
    this.notayUse = info
  }
  getNotayUse(){
    return this.notayUse
  }
  removeNotayUse(){
    this.notayUse = ''
  }

  //存储获取删除公证事项
  setNotayMatter(info:any){
    this.notayMatter = []
    this.Matters = info
    info.forEach(e => {
      this.notayMatter.push({
        notaryItemId:e.unitGuid,
        notaryItemName:e.name,
        notaryNum:1
      })
    });
  }
  getNotayMatter(){
    return this.notayMatter
  }
  getMatters(){
    return this.Matters
  }
  removeNotayMatter(){
    this.notayMatter = []
  }

  //是否代办
  setisDaiBan(info:any){
    this.isDaiBan = info
  }
  getisDaiBan(){
    return this.isDaiBan
  }

  //办理人的信息
  setTransactor(info:any){
    info.forEach(e=>{
      e.birthday = e.birthday.slice(0,10)
      // if(e.gender==1){
      //   e.gender = '男'
      // }else{
      //   e.gender = '女'
      // }
    })
    this.transactor = info
  }
  getTransactor(){
    return this.transactor
  }
  removeTransactor(){
    this.transactor = []
  }

  //代理人的信息
  setAgent(info:any){
    this.agent = info
  }
  getAgent(){
    return this.agent
  }
  removeAgent(){
    this.agent = {}
  }

  //订单号
  setOrder(info:any){
    this.orderFrom = info
  }
  getOrder(){
    return this.orderFrom
  }
}
